getApp();

var e = require("../../utils/api"), t = require("../../utils/config"), r = require("../../utils/request");

Component({
    properties: {
        column: {
            type: Number,
            value: 1
        },
        marginTop: {
            type: String,
            value: "0px"
        }
    },
    data: {
        articles: [],
        detailUrl: "../../pages/course-detais/course-detais"
    },
    lifetimes: {
        attached: function() {
            this.selectWcaCourseArticleDtoByTopNum();
        }
    },
    methods: {
        selectWcaCourseArticleDtoByTopNum: function() {
            var a = this;
            r.request(r.HttpMethod.GET, e.apiRoute.selectWcaCourseArticleDtoByTopNum, {}).then(function(e) {
                "20000" == e.code && (e.data.forEach(function(e) {
                    e.coverImageUrl = t.courseCoverImageUrl + e.coverImageUrl;
                }), a.setData({
                    articles: e.data
                }));
            });
        }
    }
});